package com.srzk.youthleagueback.mapper;

import com.srzk.youthleagueback.entity.po.Class;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

@Mapper
public interface ClassMapper {
    @InsertProvider(value = ClassProvider.class,method = "insert")
    int insert(Class record);

    @Select("select * from class where name = #{name} and grade = #{grade} and dname = #{dname}")
    Class selectByPrimaryKey(String name,String grade,String dname);

    @Select("select * from class")
    List<Class> selectAll();

    @UpdateProvider(value = ClassProvider.class,method = "update")
    int updateByPrimaryKey(Class record);
}